<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">

<jsp:directive.page errorPage="/WEB-INF/mayberry/ErrorPage.jsp"/>
<jsp:directive.page import="java.util.*"/>
<jsp:directive.page import="org.twnmayberry.dto.*"/>
<html>
    <title>Add Activity Form</title>
    <body>
        <h2>Add Activity</h2>
        
        <jsp:scriptlet>
            String handler = request.getContextPath() + "/mayberry";
        </jsp:scriptlet>
        
        <form method="POST"
            action="<%= handler %>">
            ID of POI:  <input type="text" name="id" size="25" value=""/><p/>
            <jsp:scriptlet>
              List people = (List)request.getAttribute("sampleIds");
              String sampleIds = "";
              if(people.size() == 0) {
                sampleIds = "Empty DB, populate first";
              } else {
              for(Object o : people) {
            	  POIDTO p = (POIDTO)o;
            	  sampleIds += p.getId() + ", ";
              }
                sampleIds = sampleIds.substring(0, sampleIds.length() - 2);
              }
            </jsp:scriptlet>
            <p style="font:italic">Note: Some example ids include: <%= sampleIds %></p>
            Date (mm/dd/yyyy): <input type="text" name="actDate" size="25" value=""/><p/>
            Description: <input type="text" name="description" size="256" value=""/><p/>
            Note: To make the activity dangerous, put the word "dangerous" in that exact case and spelling into the description. (EX: That dude is dangerous.)<p/>
            Type: <select name="type">
                    <jsp:scriptlet>
                      List types = (List)request.getAttribute("types");
                      for(Object type : types) {
                    	  String t = type.toString();
                    </jsp:scriptlet>
                    <option value="<%= t %>" ><%= t %></option>
                    <jsp:scriptlet>
                      }
                    </jsp:scriptlet>
                  </select>
            <input type="submit" name="command" value="Add Act"/>
        </form>
        </body>
        </html>
        